import axios from './http'

/**
 * 获取列表
 * @param params
 * @returns {AxiosPromise}
 */
export const getList = (params) => {
    return axios({
        url: "v1/component/component/type/",
        method: "get",
        params
    })
}

/**
 * 保存菜单
 * @param data
 * @returns {AxiosPromise}
 */
export const saveComponent = (data) => {
    return axios({
        url: "v1/component/component/type/",
        method: "post",
        data
    })
}
/**
 * 修改菜单
 * @param data
 * @returns {AxiosPromise}
 */
export const updateComponent = (id, data) => {
    return axios({
        url: `v1/component/component/type/${id}/`,
        method: "put",
        data
    })
}

/**
 * 获取单条数据
 * @param data
 * @returns {AxiosPromise}
 */
export const getComponentTypeDetail = (id) => {
    return axios({
        url: `v1/component/component/type/${id}/`,
        method: "get",
    })
}
/**
 * 删除菜单
 * @param id
 * @returns {AxiosPromise}
 */
export const delDetail = (id) =>{
    return axios({
        url:`v1/component/component/type/${id}/`,
        method:"delete"
    })
}